package com.avengers.common.bean.enums;

import java.util.LinkedHashMap;

/**
 * @author yu.wang
 * @since 2020-04-09 14:45
 **/
public enum EppMonitorType {
    /**
     * 不监测
     */
    none(0, "不检测"),
    /**
     * 抢注
     */
    rush(1, "仅检测抢注"),
    /**
     * EPP
     */
    epp(2, "仅检测EPP"),
    /**
     * 所有
     */
    all(3, "检测所有");

    public final Integer value;
    public final String comment;

    EppMonitorType(Integer value, String comment) {
        this.value = value;
        this.comment = comment;
    }

    public static EppMonitorType of(Integer value) {
        if (null == value) {
            return null;
        }
        for (EppMonitorType monitorType : values()) {
            if (monitorType.value.equals(value)) {
                return monitorType;
            }
        }
        return null;
    }

    public static LinkedHashMap<Integer, String> getMonitorTypeList() {
        LinkedHashMap<Integer, String> finalMap = new LinkedHashMap<>();
        for (EppMonitorType monitorType : values()) {
            finalMap.put(monitorType.value, monitorType.comment);
        }
        return finalMap;
    }
}